home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / PerfectPaint / rexx / box / RotateBlur.rx < prev    next >
Encoding:
Text File  |  2002-03-13  |  1.9 KB  |  123 lines

  1. /*     arexx Script 
  2.     Rotate Blur
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.     parse ARG Port x1 y1 x2 y2 b
  9.     
  10.     ADDRESS COMMAND
  11.     Alias=0
  12.     Opacity=85
  13.     Amplitude=5
  14.     IF EXISTS('PerfectPaint:Prefs/Rexx_Prefs/RotateBlur') THEN DO
  15.         IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/RotateBlur', "R") then DO
  16.             Amplitude= READLN('lfile')
  17.             Opacity= READLN('lfile')
  18.             Alias= READLN('lfile')
  19.             CALL CLOSE('lfile')
  20.         END
  21.     END
  22.  
  23.     ADDRESS value Port
  24.  
  25.     pp_GetDepth
  26.     D=result
  27.     IF D<24 then DO
  28.         pp_Warn 'This*script*is*only|for*24bits*Picture.'    
  29.         pp_PermitRefresh
  30.         Exit
  31.     END
  32.  
  33.     pp_DialogInit 250 95 "*Rotate*Blur*" 3
  34.         pp_Integer 0 140 5 50 16 "Amplitude*(2-16)" 1 Amplitude
  35.         pp_Integer 1 140 25 50 16 "Opacity*(0-100)" 1 Opacity
  36.         pp_Cycle   2 140 45 50 16 "Antialiasing" 1 "None|Good|High" Alias
  37.     pp_Dialog
  38.     rc=result
  39.     IF rc=0 then DO
  40.         EXIT
  41.     END
  42.  
  43.     pp_GetDialog 0
  44.     Amplitude=result
  45.  
  46.     pp_GetDialog 1
  47.     Opacity=result
  48.  
  49.     pp_GetDialog 2
  50.     Alias=result
  51.  
  52.   CALL SavePrefs('RotateBlur',Amplitude,Opacity,Alias)
  53.     ADDRESS value Port
  54.  
  55.     pp_StencilStat
  56.     Stencil=result
  57.  
  58.     pp_PicttoSpare
  59.     pp_SpareOnOff    
  60.  
  61.  if Stencil=1 then DO
  62.         pp_StencilOff
  63.     END
  64.  
  65.     W=x2-x1+1
  66.     H=y2-y1+1
  67.  
  68.     pp_BrushOpacity 50
  69.  
  70.     k=0.25
  71.     j=0.125
  72.  
  73.     Mix=50
  74.     Dec=2
  75.     do i=1 to Amplitude
  76.    pp_PickBrush x1 y1 W H 1
  77.      pp_BrushEffect 0 0 0 j Alias
  78.      pp_BrushOpacity Mix
  79.      pp_plot x1+W/2 y1+H/2
  80.    j=j+0.25
  81.     Mix=Mix-Dec
  82.     END
  83.  
  84.     IF Stencil=1 then DO
  85.         pp_StencilOn
  86.     END
  87.  
  88.     pp_FreeBrush
  89.  
  90.     pp_SpareOnOff
  91.     pp_ComposeReqOff
  92.     pp_UpdateUndoBox x1 y1 x2 y2    
  93.     pp_EffectOn
  94.     pp_BrushOpacity 100
  95.     pp_Spare
  96.     pp_Compose 0 Opacity 0
  97.     pp_Boxf x1 y1 x2 y2
  98.     pp_EffectOff
  99.     pp_ComposeReqOn
  100.  
  101. EXIT
  102.  
  103. SavePrefs: PROCEDURE
  104.     
  105.     Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
  106.     say prefname
  107.  
  108.     if EXISTS(Prefname) THEN DO
  109.         ADDRESS COMMAND
  110.         'delete >nil: '||Prefname
  111.     END
  112.  
  113.     IF OPEN('pfile',PrefName,'W') THEN DO
  114.  
  115.     do i=2 to ARG()
  116.         CALL WRITELN('pfile',ARG(i))
  117.     end
  118.  
  119.     CALL CLOSE('pfile')
  120.  
  121. RETURN
  122.  
  123.